// contains info of the monster or the rogue
class Character implements Comparable<Character> {
    private final char icon; // @ for Rogue, uppercased letter for Monster.
    private int x, y;

    public Character(int[] position, char icon) {
        this(position[0], position[1], icon);
    }

    public Character(int x, int y, char icon) {
        this.x = x;
        this.y = y;
        this.icon = icon;
    }

    public int compareTo(Character other) {
        if (x == other.getX() && y == other.getY()) return 0;
        else return -1;
    }

    public void move(int[] move) {
        move(move[0], move[1]);
    }

    private void move(int moveX, int moveY) {
        x += moveX;
        y += moveY;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int[] getPos() {
        return new int[]{x, y};
    }

    @Override
    public String toString() {
        return "" + icon;
    }

}
